#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QAction *action = new QAction(0);
    action->setText("测试");
    qDebug() << action;
    QMenu * mm = new QMenu("我靠",0);
    mm->addAction(action);
    menuBar()->addAction(mm->menuAction());
    menuBar()->addMenu(mm);
    connect(mm->menuAction(),&QAction::triggered,[](){ qDebug() << "点击";});
    connect(action,&QAction::triggered,[](){ qDebug() << "点击";});
}

MainWindow::~MainWindow()
{
    delete ui;
}
